package com.xw;


import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;


//1.配置类@SpringBootConfiguration
//2.自动加载配置@EnableAutoConfiguration 自动加载其他的配置类
//3.@ComponentScan 默认是当前类所在的包，子包
@MapperScan("com.xw.mapper")
@SpringBootApplication //启动类
public class Xw {
    public  static void main(String[] args){
        //创建ioc容器
        SpringApplication.run(Xw.class,args);
    }

//配置分页插件类
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }



}
